package com.mer.statistic.controller;

import com.mer.statistic.entity.Course;
import com.mer.statistic.service.CourseService;
import com.mer.statistic.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @program: iiphase-project-master
 * @description:
 * @author: 薛宁宁
 * @create: 2021-10-18 22:11
 **/
@RestController
@RequestMapping("/statistics/course")
@Api(tags = "课程排行")
@CrossOrigin
public class CourseController {
    @Resource
    private CourseService courseService;
    @PostMapping("/queryByCourseRanking")
    @ApiOperation(value = "根据课程查询课程数量")
    public Result queryByCourseRanking(@RequestBody Course course){
        System.out.println("----------"+course);
        Result commonResult = courseService.queryByCourseRanking(course);
        System.out.println(commonResult);
        return new Result(2000,"查询成功",commonResult);
    }
}
